#%RAML 1.0

    title: Party API
    baseUri: http://localhost:8081
    version: v1
    
    documentation:
      - title: mod-party API
        content: This documents the API calls that can be made to post party for users, and to get them
    
    types:
      party: !include party.json
      partyCollection: !include partyCollection.json
      errors: !include raml-util/schemas/errors.schema
    
    traits:
      validate: !include raml-util/traits/validation.raml
      language: !include raml-util/traits/language.raml
      pageable:  !include raml-util/traits/pageable.raml
      searchable: !include raml-util/traits/searchable.raml
    
    resourceTypes:
      collection: !include raml-util/rtypes/collection.raml
      collection-item: !include raml-util/rtypes/item-collection.raml
      item-collection-put: !include raml-util/rtypes/item-collection-put.raml
    
    /party/info:
      displayName: party
      description: 从系统中获取活动记录
      type:
        collection:
          schemaCollection: partyCollection
          schemaItem: party
          exampleCollection: !include examples/partyCollection.sample
          exampleItem: !include examples/party.sample
    
      post:
        is: [validate]
      get:
        is: [
          searchable: {description: "根据查询条件获取一些活动记录", example: "query=(isDel = 0 %{partyQuery} )"},
          pageable,
          validate
        ]

      /qr_code_attend/{id}:
             get:
              description: "获取一个签到二维码的图像流"
              responses:
                200:
                  description: "获取图像流成功"
                  body:
                    application/octet-stream:
                400:
                  description: "Bad request"
                  body:
                    text/plain:
                      example: "Bad request"
                500:
                  description: "Internal server error"
                  body:
                    text/plain:
                      example: "Internal server error"

      /qr_code_reserve/{id}:
             get:
              description: "获取一个报名二维码的图像流"
              responses:
                200:
                  description: "获取图像流成功"
                  body:
                    application/octet-stream:
                400:
                  description: "Bad request"
                  body:
                    text/plain:
                      example: "Bad request"
                500:
                  description: "Internal server error"
                  body:
                    text/plain:
                      example: "Internal server error"

      /{id}:
          displayName: party
          description: 获取，删除或更新活动
          type:
            collection-item:
              schema: party
              exampleItem: !include examples/party.sample

      /approve/{id}:
          displayName: party
          description: 审核一个活动
          type:
            item-collection-put:
               schema: party
               exampleItem: !include examples/party.sample
          put:
           is: [validate]
